package com.abso.sunlight.explorer.expressions;

import org.eclipse.core.expressions.PropertyTester;

import com.abso.sunlight.explorer.editors.LegislatorListEditor;

/**
 * A property tester checking the editor which displays a list of legislators.
 */
public class LegislatorListEditorPropertyTester extends PropertyTester {

    /* (non-Javadoc)
     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
     */
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
        LegislatorListEditor editor = (LegislatorListEditor) receiver;
        boolean expectedValueBool = ((Boolean) expectedValue).booleanValue();
        return editor.getSearch().isSaved() == expectedValueBool;
    }

}
